//
//  UseHStack.swift
//  learn-ios
//
//  Created by Dong on 2022/4/5.
//

import SwiftUI

struct UseHStack: View {
    var body: some View {
        
        // alignment 设置对齐
        // spacing 设置间距
        ScrollView(.horizontal) {
            HStack(alignment: .top, spacing: 10){
                ForEach(1...5,id: \.self) { id in
                    Text("Item : \(id.description)")
                        .padding()
                }
            }
        }
    }
}

struct UseHStack_Previews: PreviewProvider {
    static var previews: some View {
        UseHStack()
    }
}
